package com.bytecollege.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bytecollege.model.Admin;
import com.bytecollege.vo.AdminCourseVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @ClassName: AdminMapper
 * @Description:
 * @Author: Sun
 * @Date: 2022/10/18 21:03
 */
@Mapper
public interface AdminMapper extends BaseMapper<Admin> {
    /***
     * @Description: 管理员查询课程
     * @Param: [page]
     * @return: java.util.List<com.bytecollege.vo.AdminCourseVO>
     * @Author: xigua
     * @Date: 2022/10/25
     */
    @Select("select c.course_id,c.course_name,c.course_describe,c.course_pic,c.course_status,c.course_url,c2.ctype_name" +
            " from course c " +
            " left join ctype c2 on c.ctype_id=c2.ctype_id")
    Page<AdminCourseVO> getCourseByAdmin(Page<AdminCourseVO> page);
}